import { createRouter, createWebHistory } from 'vue-router'
import HomeView from '../views/HomeView.vue'
import Login from '../views/Login.vue' 
import DormitoryAdminManager from '../views/DormitoryManager.vue'
import AboutView from '../views/AboutView.vue'
import SystemAdmin from '../views/SystemAdmin.vue'
import MoveRecord from '../views/MoveRecord.vue'
import StudentManage from '@/views/StudentManager.vue'
import DormitoryAddminManager from '../views/DormitoryAdminManager.vue'
import DormitoryAdminAdd from "../views/DormitoryAdminAdd.vue";
import DormitoryAdminUpdate from "../views/DormitoryAdminUpdate.vue";
import StudentAdd from "../views/StudentAdd.vue";
import StudentUpdate from "../views/StudentUpdate.vue";
import BuildingAdd from "../views/BuildingAdd.vue";
import BuildingManager from "../views/BuildingManager.vue";
import BuildingUpdate from "../views/BuildingUpdate.vue";
import DormitoryAdd from "../views/DormitoryAdd.vue";
import DormitoryUpdate from "../views/DormitoryUpdate.vue";
import MoveoutRegister from "../views/MoveoutRegister.vue";
import DormitoryAdmin from "../views/DormitoryAdmin.vue";
import AbsentRecord from '../views/AbsentRecord.vue'
import AbsentRegister from '@/views/AbsentRegister.vue'

const router = createRouter({
  history: createWebHistory(import.meta.env.BASE_URL),
  routes: [
    {
      path: '/',
      name: 'home',
      component: () => import('../views/HomeView.vue'),
    },
    {
      path: '/login',
      name: 'login',
      component: () => import('../views/Login.vue'),
    },
    {
    path: '/dormitoryAdmin',
    name: '宿舍管理员',
    component: () => import('../views/DormitoryAdmin.vue'),
    children:[
      {
        path: '/absentrecord',
        name: '学生缺勤记录',
        component: () => import('../views/AbsentRecord.vue'),
      },
      {
        path: '/absentregister',
        name: '学生缺勤登记',
        component: () => import('../views/AbsentRegister.vue'),
      },
    ]
    },
    {
      path: '/systemAdmin',
      name: '系统管理员',
      component: () => import('../views/SystemAdmin.vue'),
      redirect: '/dormitoryAdminAdd',
      children:[
      {
      path: '/dormitoryAdminManager',
      name: '宿管管理',
      component: () => import('../views/DormitoryAdminManager.vue'),
      },
      {
         path: '/dormitoryAdminAdd',
         name: '添加宿管',
         component: () => import('../views/DormitoryAdminAdd.vue'),
      },
      {
        path: '/dormitoryAdminUpdate',
        name: '修改宿管',
        component: () => import('../views/DormitoryAdminUpdate.vue'),
      },
      {
      path: '/moveoutRecord',
      name: '学生迁出记录',
      component: () => import('../views/MoveRecord.vue'),
      },
      {
      path: '/studentAdd',
      name: '添加学生',
      component: () => import('../views/StudentAdd.vue'),
      },
      {
      path: '/studentManager',
      name: '学生管理',
      component: () => import('../views/StudentManager.vue'),
      },
      {
      path: '/studentUpdate',
      name: '修改学生',
      component: () => import ('../views/StudentUpdate.vue'),
      },
      {
        path: '/dormitoryManager',
        name: '宿舍管理',
        component: () => import('../views/DormitoryManager.vue'),
      },
      {
        path: '/dormitoryUpdate',
        name: '修改宿舍',
        component: () => import('../views/DormitoryUpdate.vue'),
      },
      {
        path: '/dormitoryAdd',
        name: '添加宿舍',
        component: () => import('../views/DormitoryAdd.vue'),
      },
      {
        path: '/buildingAdd',
        name: '添加楼宇',
        component: () => import('../views/BuildingAdd.vue'),
      },
      {
        path: '/buildingManager',
        name: '楼宇管理',
        component: () => import('../views/BuildingManager.vue'),
      },
      {
        path: '/buildingUpdate',
        name: '修改楼宇',
        component: () => import('../views/BuildingUpdate.vue'),
      },
      {
        path: '/moveoutRegister',
        name: '迁出登记',
        component: () => import('../views/MoveoutRegister.vue'),
      },
      {
        path: '/moveoutRecord',
        name: '迁出记录',
        component: () => import('../views/MoveRecord.vue'),
      },
      ]
    },
  ],
})

export default router
